<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head >
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.breadcrumb > li + li:before{
	content:'';
}
.breadcrumb li{
	   
		display: inline-block;
		position: relative;
		vertical-align: top;
		height: 40px;
		line-height: 40px;
		padding: 0 40px;
		background-color: #50ABE4;
		color: white;
		font-weight:bold;
		font-size:20px;
}
a
{
color:#FFFFFF;
font-size:15px;
}
.title{
font-size:20px;
}
.author{
font-size:15px;
}	
.breadcrumb a
{

font-weight:bold;
color:#FFFFFF;
font-size:20px;
text-align:center;

text-transform:uppercase;
}	
		.breadcrumb li:before, .breadcrumb li:after {
		  content: '';
		  position: absolute;
		  width: 0;
		  height: 0;
		}
		
		.breadcrumb li + li {
		  margin-left: 5px;
		} 
		  .breadcrumb li + li:before {
			left: 0;
			top: 0;
			border-top: 20px solid transparent;
			border-left: 20px solid antiquewhite;
			border-bottom: 20px solid transparent;
		  }
		
		
		.breadcrumb li:first-child {
		  border-radius: 20px 0 0 20px;
		}
		
		.breadcrumb li:last-child {
		  border-radius: 0 20px 20px 0;
		}
		
		.breadcrumb li:not(:last-child) {
		  padding-right: 20px;
		} 
		  .breadcrumb li:not(:last-child):after {
			z-index: 1;
			right: -20px;
			bottom: 0;
			border-top: 20px solid transparent;
			border-bottom: 20px solid transparent;
			border-left: 20px solid #50ABE4;
		  }
		
		
		.breadcrumb li:hover {
		  background-color: #EF72B6;
		}  
		  .breadcrumb li:hover::after {
			border-left-color: #EF72B6;
		  }
	
	</style>
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body style="background:#303030 ;color:#FFF">
<?php $this->beginBody() ?>

<div class="wrap" >
    <?php
    NavBar::begin([
        'brandLabel' => '软微百科',
		'brandOptions'=> ['style'=>'color:white;font-size:23px'],
        'brandUrl' => Yii::$app->homeUrl,
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);
    $menuItems = [
        ['label' => '首页', 'url' => ['/doc/index']],
	    ['label' => '高级检索', 'url' => ['/doc/advancedindex']],
        ['label' => '分类', 'url' => ['/doc/category']],
        ['label' => '用户中心', 'url' => ['/user/usercenter']],
    ];
    if (Yii::$app->user->isGuest) {
        $menuItems[] = ['label' => '注册', 'url' => ['/site/signup']];
        $menuItems[] = ['label' => '登录', 'url' => ['/site/login']];
    } else {
        $menuItems[] = '<li>'
            . Html::beginForm(['/site/logout'], 'post')
            . Html::submitButton(
                '注销 (' . Yii::$app->user->identity->username . ')',
                ['class' => 'btn btn-link logout']
            )
            . Html::endForm()
            . '</li>';
    }
    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => $menuItems,
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer"style="background:#303030 ;font-size:20px;color:#FFF">
    <div class="container">
        <p class="pull-left">&copy; 软微百科 <?= date('Y') ?></p>

        <p class="pull-right"><?= Yii::powered() ?></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
